home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
aminet
/
util
/
misc
/
vhlogger_v2.lzh
/
was.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1992-07-21
|
6KB
|
216 lines
/* $VER: was.rexx 1.00 (060792) */
/* Version 1 - 07/05/92 Vince Herried ka8cte */
/* purpose check for Worked All States elegibility */
/* arguments open - vhlogger is already running and the data base file open*/
/* debug - turns on trace, kind o verbose */
arg parms
test='n'
say "was.rexx - this program starts up 'vhlogger' and then reads"
say "through the data base looking for contacts for which you have"
say "received QSL cards. Each time one is found from a new state"
say "That call is displayed. If at the end of your data base it has"
say "found 50, it will display those states that you still need to get"
say "your Worked all States award from the ARRL."
say " "
say ""
modes= "CW SSB FM AM AMTOR RTTY PACKET ASCII FAX SSTV FSTV other"
mode_search=0
do until(ans = 'Y' | ans = 'N')
say "Are you interested in a particular mode (enter y, n, or ?)"
pull ans
if ans = '?' then do
say "By mode, I mean SSB, CW, packet ..."
say ""
end
end
if ans = 'Y' then do
do until(mode_search ~= 0)
say "Here is a list of modes, enter one:"
say modes
pull ans
mode_search = find(modes,ans)
end
end
bands = "160M 80M 40M 30M 20M 17M 15M 12M 10M 6M 2M 1.25M 70CM 33CM 23CM other"
band_search=0
do until(ans = 'Y' | ans = 'N')
say "Are you interested in a particular band (enter y, n or ?)"
pull ans
if ans='?' then
say "By band, I mean what amateur band, eg 160M 20M 2M etc."
end
if ans = 'Y' then do
do until(band_search ~= 0)
say "Here is a list of bands, enter one"
say bands
pull ans
band_search=find(bands,ans)
end
end
say ""
options results
/* here is a list of states by call area */
states.0="CO IA KS MN MO NE ND SD "
states.1="CT ME MA NH RI VT "
states.2="NJ NY "
states.3="DE MD PA "
states.4="AL FL GA KY NC SC TN VA "
states.5="AR LA MS NM OK TX "
states.6="CA "
states.7="AZ ID MT NV OR UT WA WY "
states.8="MI OH WV "
states.9="IL IN WI "
states.10="HI AK "
state_list=states.0 || states.1 || states.2 || states.3 || states.4 || states.5 ||,
states.6 || states.7 || states.8 || states.9 || states.10
if (find(parms,"DEBUG") ~= 0) then do
trace('r') /* debugging trace required? */
test='y'
end
if (find(parms,"OPEN") ~= 0) then open='y' /* already open? */
else open='n'
/* search the data base for all 50 calls */
WaitForPort "vhlogger"
if RC ~= 0 then open='n' /* my program doesn't seem to fully close*/
/* the arexx port. if not open then program*/
/* is not running. If port is open pgm may */
/* or may not be running, can't tell */
if open = 'n' then do /* data base program not running yet */
address "COMMAND"
"run vhlogger"
WaitForPort "vhlogger"
address "vhlogger"
"back" /* window to back */
"open vhlog" /* open the input file. */
if rc ~= 0 then do
say "open failed, possibly invalid file name? ending!"
"quit" /* stop the music, er program */
exit(8)
end
open = 'y'
end /* if open = 'n' */
gotone='n'
address "vhlogger"
cardno=0
do while(getone())
parse var result callsign ';' name ';' date ';' stime ';' etime ';' rsts ';',
rstr ';' address ';' city ';' state ';' zip ';' comment ';' srh ';',
xband ';' xpower ';' xantenna ';' xmode junk
if substr(srh,2,2) ~= 'YY' then iterate /* no qsl received from him */
/* also required to be made from */
/* your home QTH */
xmode = strip(xmode,'T','.') /* strip trailing period? */
/* now check for a specific mode requirement */
if mode_search ~= 0 then if xmode ~= mode_search then iterate
/* now check for a specific band requirement */
if band_search ~= 0 then if xband ~= band_search then iterate
i = index(state_list,state)
if i = 0 then iterate /* already got this state */
state_list = overlay(" ",state_list,i,2)
cardno=cardno+1 /* count it */
card.cardno=state callsign /* save state & call sign */
say card.cardno "from" state "with" 50-cardno "still needed.",
"Mode" xmode "Band" xband
if cardno > 49 then leave /* got em all, wrap it up*/
end
say ""
if cardno < 50 then do
say "You don't have all 50 states"
say "you are missing cards from" space(state_list,1)
end
else do
say "Congratulations you've got one from each of the 50 states"
say "send them to ARRL for your award/certificate."
end
say ""
do until(ans = 'Y' | ans = 'N')
say "Do want a printed copy of the above information (enter y or n)?"
pull ans
end
if ans = 'Y' then do
if (open('printer','PRT:','W') = 0) then do
say "Open of printer failed, ending"
exit(16)
end
if cardno < 50 then do
x=writeln("printer","Missing cards from the following states");
do i=1 to words(state_list)
x=writech("printer",word(state_list,i) " ");
if i//15=0 then x=writeln("printer",' ');
end
x= writeln("printer",' ');
x= writeln("printer",' ');
end
writeln("printer","Confirmed QSLs from the following:")
do i=1 to cardno
x= writech("printer",left(card.i,12))
if i//5=0 then x=writeln("printer",' ');
end
x= writeln("printer",' '); /* some printers req this to finish the output*/
end
do until(ans='Y' | ans='N')
say "Do you want to leave VHlogger running (enter y or n)?"
pull ans
end
if ans = 'N' then do
"close"
"quit"
end
exit(0)
getone:
if gotone='n' then
"first" /* go to top of the file */
else "next" /* else go the next entry */
gotone='y'
if rc=0 then return(1)
else return(0)